//
//  CFRMDishesModel.swift
//  CrazyFatReducingMeal
//
//  Created by iOS-Czz on 2023/11/8.
//

import UIKit

class CFRMDishesViewModel{
    var dataSource = [CFRMDishesModel]()
}
extension CFRMDishesViewModel{
    func getPageData(onSuccess: ((_ models: [CFRMDishesModel]) ->Void)?){
        let dataHelper = CFRMDishesModel.getUsingLKDBHelper()
        let sql = "select * from @t"
        let modelArr = dataHelper.search(withSQL: sql, to: CFRMDishesModel.self) as! [CFRMDishesModel]
        self.dataSource = modelArr
        onSuccess?(self.dataSource)
    }
}

@objcMembers
class CFRMDishesModel: CFRMModel,Codable {
    var name = ""
    var recommendation = ""
    var paired = ""
    var nutrition = ""
    var isDefault = true
    override class func getTableName() -> String {
        return  String(describing: CFRMDishesModel.self)
    }
}
